package com.casstime.ec.cloud.meeting.model;

import com.casstime.ec.cloud.meeting.dao.entity.EntityDepartment;
import com.casstime.ec.cloud.meeting.values.DepartmentDTO;
import com.casstime.ec.cloud.stastic.transform.CommonTransform;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class Department {

  @ApiModelProperty(value="部门id")
  private Integer departmentId;

  @ApiModelProperty(value="预约名称")
  private String departmentName;

  public DepartmentDTO toDTO() {
    return CommonTransform.transform(this,DepartmentDTO.class);
  }

  public static Department get(EntityDepartment entityDepartment) {
    Department department = new Department();
    if(entityDepartment == null) {
        return null;
    }
    department.setDepartmentId(entityDepartment.getId());
    department.setDepartmentName(entityDepartment.getDepartmentName());
    return department;
  }

}
